74e86f
@@ -240,7 +240,8 @@
public abstract class AbstractEnvironment implements ConfigurableEnvironment {
 		Assert.notNull(profiles, "Profile array must not be null");
 		this.activeProfiles.clear();
 		for (String profile : profiles) {
-			addActiveProfile(profile);
+			validateProfile(profile);
+			this.activeProfiles.add(profile);
 		}
 	}
 
@@ -249,9 +250,11 @@
public abstract class AbstractEnvironment implements ConfigurableEnvironment {
 			this.logger.debug(format("Activating profile '%s'", profile));
 		}
 		validateProfile(profile);
+		doGetActiveProfiles();
 		this.activeProfiles.add(profile);
 	}
 
+
 	public String[] getDefaultProfiles() {
 		return StringUtils.toStringArray(doGetDefaultProfiles());
 	}
